package pri.hillchen.std.design.pattern.single;

/**
 * Created by hillchen on 2018/3/7.
 */
public class LazyUnsafe {
    private LazyUnsafe(){

    }
    private static LazyUnsafe lazyUnsafe = null;

    /**
     * 该单例模式线程不安全，如果在判空和new执行之间其他操作对lazyUnsafe对象进行了创建，
     * 则会出现线程不安全问题
     * @return
     */
    public static LazyUnsafe getInstance(){
        if(lazyUnsafe == null){
            lazyUnsafe = new LazyUnsafe();
        }
        return lazyUnsafe;
    }
}
